3.82 \(\int \frac{\sqrt{a+c x^2} (d+e x+f x^2)}{g+h x} \, dx\)

Optimal. Leaf size=206 \[ \frac{\sqrt{a+c x^2} \left (2 \left (d h^2-e g h+f g^2\right )-h x (f g-e h)\right )}{2 h^3}-\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (\left (a h^2+2 c g^2\right ) (f g-e h)+2 c d g h^2\right )}{2 \sqrt{c} h^4}-\frac{\sqrt{a h^2+c g^2} \left (d h^2-e g h+f g^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right )}{h^4}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h} \]

[Out]

((2*(f*g^2 - e*g*h + d*h^2) - h*(f*g - e*h)*x)*Sqrt[a + c*x^2])/(2*h^3) + (f*(a + c*x^2)^(3/2))/(3*c*h) - ((2*
c*d*g*h^2 + (f*g - e*h)*(2*c*g^2 + a*h^2))*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(2*Sqrt[c]*h^4) - (Sqrt[c*g^2
 + a*h^2]*(f*g^2 - e*g*h + d*h^2)*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*h^2]*Sqrt[a + c*x^2])])/h^4

________________________________________________________________________________________

Rubi [A]  time = 0.391578, antiderivative size = 206, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.207, Rules used = {1654, 815, 844, 217, 206, 725} \[ \frac{\sqrt{a+c x^2} \left (2 \left (d h^2-e g h+f g^2\right )-h x (f g-e h)\right )}{2 h^3}-\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (\left (a h^2+2 c g^2\right ) (f g-e h)+2 c d g h^2\right )}{2 \sqrt{c} h^4}-\frac{\sqrt{a h^2+c g^2} \left (d h^2-e g h+f g^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right )}{h^4}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h} \]

Antiderivative was successfully verified.

[In]

Int[(Sqrt[a + c*x^2]*(d + e*x + f*x^2))/(g + h*x),x]

[Out]

((2*(f*g^2 - e*g*h + d*h^2) - h*(f*g - e*h)*x)*Sqrt[a + c*x^2])/(2*h^3) + (f*(a + c*x^2)^(3/2))/(3*c*h) - ((2*
c*d*g*h^2 + (f*g - e*h)*(2*c*g^2 + a*h^2))*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(2*Sqrt[c]*h^4) - (Sqrt[c*g^2
 + a*h^2]*(f*g^2 - e*g*h + d*h^2)*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*h^2]*Sqrt[a + c*x^2])])/h^4

Rule 1654

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff
[Pq, x, Expon[Pq, x]]}, Simp[(f*(d + e*x)^(m + q - 1)*(a + c*x^2)^(p + 1))/(c*e^(q - 1)*(m + q + 2*p + 1)), x]
 + Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*
f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(a*e^2*(m + q - 1) - c*d^2*(m + q + 2*p + 1) - 2*c*d*e*(
m + q + p)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, c, d, e, m, p}, x] && PolyQ[Pq
, x] && NeQ[c*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && True) &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[
p] || ILtQ[p + 1/2, 0]))

Rule 815

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[((d + e*x)^(
m + 1)*(c*e*f*(m + 2*p + 2) - g*c*d*(2*p + 1) + g*c*e*(m + 2*p + 1)*x)*(a + c*x^2)^p)/(c*e^2*(m + 2*p + 1)*(m
+ 2*p + 2)), x] + Dist[(2*p)/(c*e^2*(m + 2*p + 1)*(m + 2*p + 2)), Int[(d + e*x)^m*(a + c*x^2)^(p - 1)*Simp[f*a
*c*e^2*(m + 2*p + 2) + a*c*d*e*g*m - (c^2*f*d*e*(m + 2*p + 2) - g*(c^2*d^2*(2*p + 1) + a*c*e^2*(m + 2*p + 1)))
*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[p, 0] && (IntegerQ[p] ||  !R
ationalQ[m] || (GeQ[m, -1] && LtQ[m, 0])) &&  !ILtQ[m + 2*p, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*
m, 2*p])

Rule 844

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 725

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rubi steps

\begin{align*} \int \frac{\sqrt{a+c x^2} \left (d+e x+f x^2\right )}{g+h x} \, dx &=\frac{f \left (a+c x^2\right )^{3/2}}{3 c h}+\frac{\int \frac{\left (3 c d h^2-3 c h (f g-e h) x\right ) \sqrt{a+c x^2}}{g+h x} \, dx}{3 c h^2}\\ &=\frac{\left (2 \left (f g^2-e g h+d h^2\right )-h (f g-e h) x\right ) \sqrt{a+c x^2}}{2 h^3}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h}+\frac{\int \frac{3 a c^2 h^2 \left (f g^2-h (e g-2 d h)\right )-3 c^2 h \left (2 c d g h^2+(f g-e h) \left (2 c g^2+a h^2\right )\right ) x}{(g+h x) \sqrt{a+c x^2}} \, dx}{6 c^2 h^4}\\ &=\frac{\left (2 \left (f g^2-e g h+d h^2\right )-h (f g-e h) x\right ) \sqrt{a+c x^2}}{2 h^3}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h}+\frac{\left (\left (c g^2+a h^2\right ) \left (f g^2-e g h+d h^2\right )\right ) \int \frac{1}{(g+h x) \sqrt{a+c x^2}} \, dx}{h^4}-\frac{\left (2 c d g h^2+(f g-e h) \left (2 c g^2+a h^2\right )\right ) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{2 h^4}\\ &=\frac{\left (2 \left (f g^2-e g h+d h^2\right )-h (f g-e h) x\right ) \sqrt{a+c x^2}}{2 h^3}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h}-\frac{\left (\left (c g^2+a h^2\right ) \left (f g^2-e g h+d h^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{c g^2+a h^2-x^2} \, dx,x,\frac{a h-c g x}{\sqrt{a+c x^2}}\right )}{h^4}-\frac{\left (2 c d g h^2+(f g-e h) \left (2 c g^2+a h^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{2 h^4}\\ &=\frac{\left (2 \left (f g^2-e g h+d h^2\right )-h (f g-e h) x\right ) \sqrt{a+c x^2}}{2 h^3}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h}-\frac{\left (2 c d g h^2+(f g-e h) \left (2 c g^2+a h^2\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{2 \sqrt{c} h^4}-\frac{\sqrt{c g^2+a h^2} \left (f g^2-e g h+d h^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{c g^2+a h^2} \sqrt{a+c x^2}}\right )}{h^4}\\ \end{align*}

Mathematica [A]  time = 0.477019, size = 224, normalized size = 1.09 \[ \frac{\left (h (d h-e g)+f g^2\right ) \left (-\sqrt{a h^2+c g^2} \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right )-\sqrt{c} g \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )+h \sqrt{a+c x^2}\right )}{h^4}+\frac{\sqrt{a+c x^2} \left (\sqrt{c} x \sqrt{\frac{c x^2}{a}+1}+\sqrt{a} \sinh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )\right ) (e h-f g)}{2 \sqrt{c} h^2 \sqrt{\frac{c x^2}{a}+1}}+\frac{f \left (a+c x^2\right )^{3/2}}{3 c h} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sqrt[a + c*x^2]*(d + e*x + f*x^2))/(g + h*x),x]

[Out]

(f*(a + c*x^2)^(3/2))/(3*c*h) + ((-(f*g) + e*h)*Sqrt[a + c*x^2]*(Sqrt[c]*x*Sqrt[1 + (c*x^2)/a] + Sqrt[a]*ArcSi
nh[(Sqrt[c]*x)/Sqrt[a]]))/(2*Sqrt[c]*h^2*Sqrt[1 + (c*x^2)/a]) + ((f*g^2 + h*(-(e*g) + d*h))*(h*Sqrt[a + c*x^2]
 - Sqrt[c]*g*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]] - Sqrt[c*g^2 + a*h^2]*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*
h^2]*Sqrt[a + c*x^2])]))/h^4

________________________________________________________________________________________

Maple [B]  time = 0.301, size = 1265, normalized size = 6.1 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)*(c*x^2+a)^(1/2)/(h*x+g),x)

[Out]

1/3*f*(c*x^2+a)^(3/2)/c/h+1/2/h*e*x*(c*x^2+a)^(1/2)+1/2/h*e*a/c^(1/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))-1/2/h^2*f*
g*x*(c*x^2+a)^(1/2)-1/2/h^2*f*g*a/c^(1/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))+1/h*((x+g/h)^2*c-2*c*g/h*(x+g/h)+(a*h^
2+c*g^2)/h^2)^(1/2)*d-1/h^2*((x+g/h)^2*c-2*c*g/h*(x+g/h)+(a*h^2+c*g^2)/h^2)^(1/2)*e*g+1/h^3*((x+g/h)^2*c-2*c*g
/h*(x+g/h)+(a*h^2+c*g^2)/h^2)^(1/2)*f*g^2-1/h^2*c^(1/2)*g*ln((-c*g/h+(x+g/h)*c)/c^(1/2)+((x+g/h)^2*c-2*c*g/h*(
x+g/h)+(a*h^2+c*g^2)/h^2)^(1/2))*d+1/h^3*c^(1/2)*g^2*ln((-c*g/h+(x+g/h)*c)/c^(1/2)+((x+g/h)^2*c-2*c*g/h*(x+g/h
)+(a*h^2+c*g^2)/h^2)^(1/2))*e-1/h^4*c^(1/2)*g^3*ln((-c*g/h+(x+g/h)*c)/c^(1/2)+((x+g/h)^2*c-2*c*g/h*(x+g/h)+(a*
h^2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________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)*(c*x^2+a)^(1/2)/(h*x+g),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)*(c*x^2+a)^(1/2)/(h*x+g),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sqrt{a + c x^{2}} \left (d + e x + f x^{2}\right )}{g + h x}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)*(c*x**2+a)**(1/2)/(h*x+g),x)

[Out]

Integral(sqrt(a + c*x**2)*(d + e*x + f*x**2)/(g + h*x), x)

________________________________________________________________________________________

Giac [A]  time = 1.26604, size = 375, normalized size = 1.82 \begin{align*} \frac{1}{6} \, \sqrt{c x^{2} + a}{\left ({\left (\frac{2 \, f x}{h} - \frac{3 \,{\left (c f g h^{8} - c h^{9} e\right )}}{c h^{10}}\right )} x + \frac{2 \,{\left (3 \, c f g^{2} h^{7} + 3 \, c d h^{9} + a f h^{9} - 3 \, c g h^{8} e\right )}}{c h^{10}}\right )} + \frac{2 \,{\left (c f g^{4} + c d g^{2} h^{2} + a f g^{2} h^{2} + a d h^{4} - c g^{3} h e - a g h^{3} e\right )} \arctan \left (-\frac{{\left (\sqrt{c} x - \sqrt{c x^{2} + a}\right )} h + \sqrt{c} g}{\sqrt{-c g^{2} - a h^{2}}}\right )}{\sqrt{-c g^{2} - a h^{2}} h^{4}} + \frac{{\left (2 \, c^{\frac{3}{2}} f g^{3} + 2 \, c^{\frac{3}{2}} d g h^{2} + a \sqrt{c} f g h^{2} - 2 \, c^{\frac{3}{2}} g^{2} h e - a \sqrt{c} h^{3} e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{2 \, c h^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)*(c*x^2+a)^(1/2)/(h*x+g),x, algorithm="giac")

[Out]

1/6*sqrt(c*x^2 + a)*((2*f*x/h - 3*(c*f*g*h^8 - c*h^9*e)/(c*h^10))*x + 2*(3*c*f*g^2*h^7 + 3*c*d*h^9 + a*f*h^9 -
 3*c*g*h^8*e)/(c*h^10)) + 2*(c*f*g^4 + c*d*g^2*h^2 + a*f*g^2*h^2 + a*d*h^4 - c*g^3*h*e - a*g*h^3*e)*arctan(-((
sqrt(c)*x - sqrt(c*x^2 + a))*h + sqrt(c)*g)/sqrt(-c*g^2 - a*h^2))/(sqrt(-c*g^2 - a*h^2)*h^4) + 1/2*(2*c^(3/2)*
f*g^3 + 2*c^(3/2)*d*g*h^2 + a*sqrt(c)*f*g*h^2 - 2*c^(3/2)*g^2*h*e - a*sqrt(c)*h^3*e)*log(abs(-sqrt(c)*x + sqrt
(c*x^2 + a)))/(c*h^4)